#!/usr/bin/env python

import sys,os

def build( bld ):
    for arch in bld.lst_variants:
        if arch == 'default': continue

        obj = bld.new_task_gen(features='cc cprogram')
        obj.env = bld.env_of_name(arch).copy()
        obj.source = """
            SDR.c
            SDRutils/coeffs.c
            SDRutils/frequencyFilter.c
            SDRutils/morseDecoder.c
            SDRutils/normalize.c
            SDRutils/utils.c
            SDRutils/wavIO16.c
        """
        obj.target = 'sdr'
        obj.name = 'sdr'
        obj.includes = 'SDRutils ../../suites/OmpSCR_v2.0/include'
        obj.uselib_local = 'ompsrc_cc_'+arch+' gomp_'+arch+' pthread_stub_'+arch 
        obj.env.append_unique('CFLAGS', '-fopenmp')
        obj.env.append_unique('CCFLAGS', '-fopenmp')
        obj.env.append_unique('LINKFLAGS', '-lm')

